import java.util.Scanner;

public class code2 {
    static int n = 0;
    static int count = 0;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        dfs(n,n);
        System.out.println(count);
    }
    public static void dfs(int sum,int k) {
        //sum表示：当前数的大小;k代表最高位的数
        //递归出口
        count++;
        if (k==1) {
            return;
        }
        for (int i = 1; i <= k/2; i++) {
            dfs(sum*10+i,i);
        }
    }
}
